import { resolve } from 'path';

import FX from 'fs-extra';

import { C } from '../../lib/global.js';


const method = 'get';

const handle = async function() {
	const pathMeta = resolve(C.path.vowad, '@meta.json');

	try {
		return {
			success: true,
			data: FX.readJSONSync(pathMeta)
		};
	}
	catch(error) {
		return {
			success: true,
			data: {
				version: 0,
				wad: {},
			}
		};
	}
};


export { method, handle };
